<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'mortgage.label', default: 'Mortgage')}"/>
    <title>机构待办</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    @media screen and (min-width:1900px) and (max-width:1920px) {
        .flex{
            display: flex;justify-content: center;align-items: center;
        }
    }
    .select2-container .select2-choices .select2-search-field input,.select2-container .select2-choice,.select2-container .select2-choices{

        color: #999;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDTATA PLS</span>
                    </li>
                    <li>
                        <span>机构待办</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="accountPending" class="form-horizontal" role="form" id="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick=""><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group" id="bug1">
                    <input type="hidden" name="flag" value="${this.params?.flag}">
                    <input type="hidden" name="status" value="${this.params?.status}">
                    <div class="row ">
                        <div class="form-group col-sm-3">
                            <label for="district" class="col-sm-3 control-label">机构名称</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="name" id="name" value="${params?.name}" placeholder="请输入机构名称">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">工作流</label>
                            <div class="col-sm-9">
                                <g:select class="form-control" name="workflow" id="workflow"
                                  from="${com.cindata.Workflow.findAllByType(com.cindata.dictionary.WorkflowType.findByName('机构'))}"
                                  valueMessagePrefix="status" optionKey="id" optionValue="name"
                                  value="${params?.workflow}"
                                  noSelection="${['': '请选择工作流']}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>

        <div class="row">
            <div class="hpanel hgreen">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                    </div>
                    &nbsp;&nbsp;
                </div>

                <div class="panel-body no-padding">
                    <div class="table-responsive">
                        <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="esateTable">
                            <thead>
                            <tr>
                                <g:sortableColumn property="name" title="机构名称" params="${params}"/>
                                <g:sortableColumn property="type" title="机构类型" params="${params}"/>
                                <g:sortableColumn property="city" title="城市" params="${params}"/>
                                <g:sortableColumn property="district" title="行政区" params="${params}"/>
                                <g:sortableColumn property="workflowName" title="工作流名称" params="${params}"/>
                                <g:sortableColumn property="workflow" title="工作流" params="${params}"/>
                                <g:sortableColumn property="name" title="当前阶段" params="${params}"/>
                                <g:sortableColumn property="city" title="当前状态" params="${params}"/>
                                <g:sortableColumn property="district" title="创建时间" params="${params}"/>
                                <g:sortableColumn property="fullName" title="修改时间" params="${params}"/>
                            </tr>
                            </thead>
                            <tbody>
                            <g:each in="${workflowInstanceUserList}">
                                <tr>
                                    <td ><g:link style="color: #3498DB" controller="account" action="accountPendingShow" class="firstTd" id="${it[8]?.id}">${it[1]}</g:link></td>
                                    <td>${it[7]?.type?.name}</td>
                                    <td>${it[7]?.city?.name}</td>
                                    <td>${it[7]?.district?.name}</td>
                                    <td>${it[2]}</td>
                                    <td>${it[8]?.workflow.name}</td>
                                    <td>${it[3]}</td>
                                    <td>${it[4]}</td>
                                    <td><g:formatDate date="${it[5]}" format="yyyy-MM-dd HH:mm:ss" ></g:formatDate></td>
                                    <td><g:formatDate date="${it[6]}" format="yyyy-MM-dd HH:mm:ss" ></g:formatDate></td>
                                </tr>
                            </g:each>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="panel-footer">
                    <div class="pagination">
                        <g:paginate action="accountPending" total="${count ?: 0}" params="${params}"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
<g:javascript>
        //重置按钮
        $("#resetBtn").click(function () {
            $("#name").val("");
            $("#workflow").val("");
            $('#s2id_workflow span:first').html('请选择工作流');
        });
</g:javascript>
</body>
</html>
